<grammar>  = <rule>* ;
<rule>     = <name> '=' <expr> ';' ;
<expr>     = <variant> ( '|' <variant> )* ;
<variant>  = ( <quantor> | <diff> | <toText> )* ';'
<diff>     = <quantor> '-' <quantor> ;
<toText>   = '#' <quantor> ;
<quantor>  = <element> | <optional> | <multi> | <much> ;
<optional> = <element> '?' ;
<multi>    = <element> '*' ;
<much>     = <element> '+' ;
<element>  = <name> | <literal> | <group> | <class> | <any> ;
<name>     = '<' <QName> '>' ;
<literal>  = '"' [^"]* '"' | "'" [^']* "'" ;
<any>      = '.' ;
<group>    = '(' <expr> ')' ;
<QName>    = ( <NCName> ':' )? <NCName> ;
<NCName>   = <NCNStratChar> <NCNChar>* ;
<NCNStrat> = #[_a-zA-Z] ;
<NCNChar>  = #[-.0-9] | <NCNStrat> ;
<class>    = '[' <not>? <body> ']' ;
<not>      = '^' ;
<body>     = ( <range> | <char> )+ ;
<range>    = <char> '-' <char> ;
<char>     = #(. - <cpecialChars>)
             | '\' <cpecialChar>
<cpecialChar> = #('\' | ']' | '-' | '^' | '#') ;
